package com.sinping.qh.repository.mongo.lab;

import com.sinping.qh.domain.lab.LabInspectItemDomain;
import com.sinping.qh.domain.lab.LabInspectItemTreeDomain;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * @author jiahuaiqing
 * @create 2018/6/9
 */
public interface LabInspectItemTreeRepository extends MongoRepository<LabInspectItemTreeDomain,String> {
    //1级
    LabInspectItemTreeDomain findByItemNameAndItemCategoryAndItemSubcategory(String name, String category, String subCategory);
    List<LabInspectItemTreeDomain> findByItemNameAndItemCategoryAndItemSubcategoryAndStatus(String name, String category, String subCategory,String status);
    //2级
    LabInspectItemTreeDomain findByItemNameAndItemParentIdAndItemCategory(String name,String parentId,String category);
    LabInspectItemTreeDomain findByItemNameAndItemParentIdAndItemLevel(String name,String parentId,String level);
    List<LabInspectItemTreeDomain> findByItemNameAndItemParentIdAndItemLevelAndStatus(String name,String parentId,String level,String status);
    //3级
    LabInspectItemTreeDomain findByItemNameAndItemParentId(String name,String parentId);
    LabInspectItemTreeDomain findByItemOrder(ObjectId itemOrder);

    List<LabInspectItemTreeDomain> findByItemParentId(String id);
    List<LabInspectItemTreeDomain> findByItemParentIdAndStatus(String id,String status);


    List<LabInspectItemTreeDomain> findByItemLevel(String level);
}
